package com.simple.piger.service;

import com.baomidou.mybatisplus.service.IService;
import com.simple.piger.utils.AjaxResult;
import com.simple.piger.constant.AjaxCode;
import com.simple.piger.dto.resp.SysUserListRespDto;
import com.simple.piger.entity.CmsSysUser;

import java.util.List;

public interface CmsUserService extends IService<CmsSysUser> {
    AjaxResult<String> login(String userName, String password, String tokenSession) throws Exception;

    /**
     * 获取帐号配置列表页的总条数
     * @Author  donghj
     * @Date    2017/12/7 13:45
     */
    int getUserListCount(Integer roleId,
                         Boolean locked);


    /**
     * 获取帐号配置列表页的分页信息
     * @Author  donghj
     * @Date    2017/12/7 13:45
     */
    List<SysUserListRespDto> getUserList(Integer roleId,
                                         Boolean locked,
                                         Integer page,
                                         Integer limit);

    /**
     * 重置帐号密码
     * @Author  donghj
     * @Date    2018/6/13 15:15
     */
    void resetUserPwd(String id);

    /**
     * 新增帐号信息
     * @Author  donghj
     * @Date    2017/12/7 14:22
     */
    String addUser(CmsSysUser cmsSysUser,
                   String[] userRolesAdd);

    /**
     * 修改帐号信息
     * @Author  donghj
     * @Date    2017/12/7 14:47
     */
    String editUser(CmsSysUser cmsSysUser,
                    String[] userRolesAdd,
                    String[] userRolesDel);

    /**
     * 用户修改密码
     * @Author  donghj
     * @Date    2017/12/7 11:08
     */
    AjaxCode editPWD(String id,
                     String old_password,
                     String new_password);

    /**
     * 用户注册
     * @param username
     * @param password
     * @param roleId
     * @return
     */
    AjaxCode register(String username, String password, String roleId, String companyId);
}
